<?php
@session_start();
require_once '../../config/config.inc';
$conn = mysql_connect(DB_HOST,DB_USER,DB_PASSWORD);
if(!$conn){
	echo mysql_error();
}

$db=mysql_select_db(DB_DATABASE);
if(!$db){
	mysql_error();
}
$name=$_POST['fname'];
$mail=$_POST['chmail'];
if(isset($_SESSION['USER_ID'])){
$id=$_SESSION['USER_ID'];	
}
if (isset($_POST['submit'])){
$qry=mysql_query("update`user` set fullname='$name',email='$mail' where id='$id'");
if (!$qry){
		echo mysql_error();	
}
else{
	header("location:../profile.php?stats=success");
	echo mysql_error();
}}
?>